<template>
  <div class="card">
    <div v-if="statusTitle" class="card-bd">
      <h4
        :class="{ hasGutter: statusDesc1}"
        class="card-bd-title">{{ statusTitle }}</h4>
      <p  class="card-bd-desc">{{ statusDesc1 }}</p>
      <p class="card-bd-desc">{{ statusDesc2 }}</p>
    </div>
    <div class="card-ft">
      <a
        v-on:click="action"
        class="card-ft-action"
        href="javascript:;"
      >{{ statusAction }}</a>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'orderStatus',
    props: {
      statusTitle: {
        type: String,
        required: true
      },
      statusDesc1: {
        type: String
      },
      statusDesc2: {
        type: String
      },
      statusAction: {
        type: String,
        required: true
      }
    },
    methods: {
      action() {
        this.$emit('action')
      }
    }
  }
</script>

<style lang="less" scoped>
  .card {
    margin-top: 20px;
    text-align: center;
    border-radius: 2px;
    box-shadow: 0 1px 1px 0 rgba(213,213,213,.3);
    background-color: #fff;
  }

  .card-bd {
    padding-top: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f5f5f5;
  }

  .card-ft {
    padding-top: 18px;
    padding-bottom: 15px;
  }

  .card-bd-title {
    font-size: 16px;
    font-weight: 400;
  }

  .card-bd-desc {
    color: #808080;
    font-size: 14px;
  }

  .card-ft-action {
    display: inline-block;
    width: 124px;
    height: 36px;
    line-height: 36px;
    border: 1px solid #ff624c;
    color: #ff624c;
    &:active {
      opacity: .5;
    }
  }

  .hasGutter {
    margin-bottom: 15px;
  }
</style>
